import request from '@/utils/request'

import variable from '@/utils/variables'
const baseURL = variable.URL.baseURL

// 订单列表
export function getOrderList(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/list',
	    method: 'POST',
	    data: params
	})
}

// 查询会员订单数
export function getOrderNums() {
	return request({
	    baseURL: baseURL,
	    url: '/order/select_order_num',
	    method: 'GET'
	})
}

// 提醒发货
export function reminderShipment(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/reminder_shipment',
	    method: 'PUT',
	    params: params
	})
}

// 取消订单
export function cancelOrder(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/cancel_order',
	    method: 'POST',
	    params: params
	})
}

// 再次购买
export function againBuyOrder(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/cart/re_insert_cart',
	    method: 'POST',
	    params: params
	})
}

// 申请取消订单
export function applyCancelOrder(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/apply_cancel_order',
	    method: 'POST',
	    params: params
	})
}

// 订单详情
export function getOrderDetail(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/detail',
	    method: 'GET',
	    params: params
	})
}

// 确认收货
export function confirmReceipt(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/confirm_receipt',
	    method: 'PUT',
	    params: params
	})
}

//查询单个订单对应的单个评论信息
export function getOrderEvaluationList(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/product_evaluation_list',
	    method: 'GET',
	    params: params
	})
}

//获取订单物流信息
export function getLogisticsInfo(params) {
	return request({
	    baseURL: baseURL,
	    url: '/logistics/context/list',
	    method: 'GET',
	    params: params
	})
}

//新增商品评价
export function addOrderValuation(params) {
	return request({
	    baseURL: baseURL,
	    url: '/evaluation/insert',
	    method: 'POST',
	    data: params
	})
}

//订单评价列表
export function getEvaluationList(params) {
	return request({
	    baseURL: baseURL,
	    url: '/order/evaluation_list',
	    method: 'POST',
	    data: params
	})
}

//订单评价删除
export function deleteEvaluation(params) {
	return request({
		baseURL: baseURL,
		url: '/evaluation/delete_by_id',
		method: 'DELETE',
		params: params
	})
}

//订单评价详情
export function evaluationDetail(params) {
	return request({
		baseURL: baseURL,
		url: '/evaluation/search_by_id',
		method: 'GET',
		params: params
	})
}


